3 Author: Andrés Mejía-Posada
4 (http://blogaritmo.factorcomun.org)
29 #define D(x) cout << #x " is " << x << endl
32 //freopen("gattaca.in", "r", stdin);
41 for (int d
=n
-1; d
>0; --d
){
43 for (int i
=0, j
; (j
= i
+ d
) <= n
; ++i
){
44 cnt
[s
.substr(i
, d
)]++;
45 //cout << s.substr(i, d) << " = " << cnt[s.substr(i, d)] << endl;
47 for (map
<string
, int>::iterator i
= cnt
.begin(); i
!= cnt
.end(); ++i
){
49 cout
<< i
->first
<< " " << i
->second
<< endl
;
51 d
= -1; //end outer loop
56 if (!solved
) cout
<< "No repetitions found!\n";